{% extends "base_generic.html" %}
{% load static %}

{% block content %}
<div class="container mt-4">
    <div class="card">
        <div class="card-header bg-primary text-white">
            <h1 class="mb-0"><i class="fas fa-tags"></i> {% if form.instance.pk %}编辑类型{% else %}添加类型{% endif %}</h1>
        </div>
        <div class="card-body">
            <form action="" method="post">
                {% csrf_token %}
                <div class="mb-3">
                    <label for="id_name" class="form-label">类型名称:</label>
                    <input type="text" id="id_name" name="name" class="form-control" value="{{ form.instance.name|default:'' }}" required>
                </div>
                <div class="text-end">
                    <a href="{% url 'genres' %}" class="btn btn-secondary">取消</a>
                    <button type="submit" class="btn btn-primary">提交</button>
                </div>
            </form>
        </div>
    </div>
</div>
{% endblock %}